//
//  main.cpp
//  LightBasic
//
//  Created by Albert on 19/03/2011.
//  Copyright 2011 LightBasic Development Team. All rights reserved.
//
 
#include "Context.h"
#include "Parser.h"
#include "StringRef.h"
using namespace lbc;

int main (int argc, const char * argv[])
{
    
    try {
        Context ctx;
        // current working dir
        ctx.Add(FS::current_path().string(), Context::TypeGlobalPath);
        // executable path
        ctx.Add(FS::path(argv[0]).parent_path().string(), Context::TypeGlobalPath);
        // Add samples path
        ctx.Add("samples", Context::TypeSourcePath);
        // add HelloWorld.bas
        ctx.Add("Tuple.bas", Context::TypeSource);
        // the parser
        Parser parser(ctx);
        // parse the files
        parser.Parse();
    } catch (Exception & e) {
        std::cout << e.what() << "\n";
    }

    return EXIT_SUCCESS;
}

